package com.bitmain.mmst.feature.time;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import com.bitmain.mmst.common.util.SpringContextHolder;

/**
 * 
 *
 * @author Richard - rui.wu@bitmain.com
 * @since 2016年8月12日 
 *
 */
public class Test implements ApplicationContextAware{
	
	ApplicationContext applicationContext;
	
	public void initialize(){
		System.out.println("执行了测试方法");
		
		/*if(ac == SpringContextHolder.getApplicationContext()){
			System.out.println("获取到了ApplicationContext上下文");
		}*/
	}
	
	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
		System.out.println("获取到了ApplicationContext上下文");
		if(applicationContext ==SpringContextHolder.getApplicationContext()){
			System.out.println("获取到同样的ApplicationContext");
		}
	}
}
